package com.linkage.event.service;

import com.github.pagehelper.PageInfo;
import com.linkage.event.pojo.entity.*;
import com.linkage.event.pojo.vo.EventMessageVo;
import com.linkage.event.pojo.vo.EventShowVo;
import com.linkage.event.pojo.vo.EventTypeVo;
import com.linkage.event.pojo.vo.TaskVo;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

public interface EventOperationService {
    /**
     * 创建事件
     * @param em
     */
    String createEvent(EventMessage em) throws Exception;

    /**
     * 提交事件
     * @param eventTask
     * @throws Exception
     */
    void commitEvent(EventTask eventTask,String userToken) throws Exception;

    /**
     * 指派事件
     * @param eventMsgId
     * @param designateUserIds
     * @throws Exception
     */
    void designateEvent(String eventMsgId, List<String> designateUserIds,String token) throws Exception;

    /**
     * 查询事件详情
     * @param eventMessageId
     * @return
     */
    EventShowVo singleEventShow(String eventMessageId) throws Exception;

    /**
     * 常见问题列表查询
     * @param pageNo
     * @param pageSize
     * @param title
     * @param type
     * @return
     */
    PageInfo<EventMessageVo> listEventShow(Integer pageNo, Integer pageSize, EventMessage eventMessage, String startDate, String endDate, String userToken) throws Exception;

    /**
     * 依据事件上级类型代码查询事件类型信息集合
     * @param superiorTypeCode
     * @return
     * @throws Exception
     */
    List<EventType> selectBySuperiorTypeCode(String superiorTypeCode,String status) throws Exception;

    /**
     * 依据事件类型代码查询事件类型信息
     * @param eventTypeCode
     * @return
     */
    EventType selectByEventTypePrimaryKey(String eventTypeCode);

    /**
     * 依据事件id和完成人修改任务信息
     * @param record
     * @return
     * @throws Exception
     */
    void updateEventTaskByPrimaryKeySelective(EventTask record) throws Exception;

    /**
     * 通过事件ID查询任务信息
     * @param eventMsgId
     * @return
     * @throws Exception
     */
    List<EventTask> selectEventTaskByEventMsgId(String eventMsgId) throws Exception;

    /**
     * 查询后台事件统计
     * @return
     */
    Map<String,Integer> statisticEventCount(String userCode,String token);

    /**
     * 根据用户类型统计事件数量
     * @param personClass
     * @param userCode
     * @param token
     * @return
     */
    List<Map<String,Object>> statisticEventCountByPersonClass(String personClass, String userCode,String token);

    /**
     * 事件列表分页查询
     * @param page
     * @param pageSize
     * @param eventTask
     * @param eventDisposeStatus
     * @return
     */
    PageInfo<EventMessage> queryListByPage(Integer page, Integer pageSize, EventTask eventTask, String eventDisposeStatus);
}
